package com.wkbb.common.enums;


/**
 * @author luowenyan
 */

public enum SexTypeEnum {
    /**
     * 男
     */
    MAN(1,"男"),
    /**
     * 女
     */
    WOMAN(2,"女"),
    /**
     * 未知
     */
    UNKNOWN(0,"未知");

    private SexTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private Integer value;

    private String desc;

    public Integer getValue() {
        return this.value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return this.desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (SexTypeEnum sexTypeEnum : SexTypeEnum.values()) {
            if (sexTypeEnum.getValue().intValue()==value) {
                return sexTypeEnum.getDesc();
            }
        }
        return null;
    }

    public static Integer getValue(String desc) {
        for (SexTypeEnum sexTypeEnum : SexTypeEnum.values()) {
            if (sexTypeEnum.getDesc().equals(desc)) {
                return sexTypeEnum.getValue();
            }
        }
        return UNKNOWN.getValue();
    }
}
